Skip to content

Some Engineer logics on Warheads #1801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

FS-21
Copy link
Contributor

@FS-21 FS-21 commented Aug 7, 2025

Engineer logics on Warheads

  • Now any InfantryType, VehicleType, BuildingType or AircraftType can execute some operations engineers do without loosing the firer in the process.
  • FakeEngineer.CanRepairBridges, if set to true, when a building with BridgeRepairHut=yes linked to a bridge is affected by the Warhead then all destroyed bridge sections will be fixed.
  • FakeEngineer.CanDestroyBridges, if set to true, when a building with BridgeRepairHut=yes linked to a bridge is affected by the Warhead then all the bridge will be destroyed.
  • FakeEngineer.CanCaptureBuildings, if set to true, a building with Capturable=true or NeedsEngineer=true is affected by the Warhead then the building will be captured by the house's firer.
  • FakeEngineer.DisarmBombs, if set to true, an attached bomb will be removed if the target is affected by the Warhead.

In rulesmd.ini:

[SOMEWARHEAD]                          ; WarheadType
FakeEngineer.CanRepairBridges=false    ; boolean
FakeEngineer.CanDestroyBridges=false   ; boolean
FakeEngineer.CanCaptureBuildings=false ; boolean
FakeEngineer.DisarmBombs=false         ; boolean

Regarding "Forcing specific weapon against certain targets":

  • ForceWeapon.Capture forces specified weapon to be used if the target building is capturable.

In rulesmd.ini:

[SOMETECHNO]   
ForceWeapon.Capture=-1     ; integer, -1 to disable

FS-21 added 12 commits July 25, 2025 18:10
- Now `infantry` and `units` can execute some operations engineers do without loosing the firer like happens with engineers.
- `FakeEngineer.CanRepairBridges`, if set to true, when a building with `BridgeRepairHut=yes` linked to a bridge is affected by the Warhead then all destroyed bridge sections will be fixed.
- `FakeEngineer.CanDestroyBridges`, if set to true, when a building with `BridgeRepairHut=yes` linked to a bridge is affected by the Warhead then all the bridge will be destroyed.
- `FakeEngineer.CanCaptureBuildings`, if set to true, a building with `Capturable=true` or `NeedsEngineer=true` is affected by the Warhead then the building will be captured by the house's firer.

In `rulesmd.ini`:
```ini
[SOMEWARHEAD]                          ; WarheadType
FakeEngineer.CanRepairBridges=false    ; boolean
FakeEngineer.CanDestroyBridges=false   ; boolean
FakeEngineer.CanCaptureBuildings=false ; boolean
```
Removed all repetitive code related to checks and placed all that in a new method called CanBeAffectedByFakeEngineer(...)
Found a silent crash. Code tweaks
- Added ForceWeapon.Capture.
- Added FakeEngineer.BombDisarm.
- Code cleanup and improvements.
@FS-21
Copy link
Contributor Author

FS-21 commented Aug 7, 2025

Example of a soldier using multiweapons with these tags in warheads:
CABAL_Engineer_new_changes_01

Copy link

github-actions bot commented Aug 7, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@NetsuNegi
Copy link
Contributor

warhead has its own BombDisarm, why do you add FakeEngineer.DisarmBombs ?

@fagonghaiwo
Copy link

FakeEngineer.DisarmBombs & FakeEngineer.CanDestroyBridges dont work

FS-21 added 2 commits August 12, 2025 08:24
and code improvements like adding the "send event" in the capture building, because I think the radar event the capture function has doesn't trigger the Enter event in map triggers.
Also, now can be triggered both repair bridge & destroy bridge depending of the current bridge status if both tags are enabled in the warhead.
@FS-21
Copy link
Contributor Author

FS-21 commented Aug 12, 2025

warhead has its own BombDisarm, why do you add FakeEngineer.DisarmBombs ?

Vanilla tag "BombDisarm" makes the wapon unusable for other purposes that isn't defuse bombs, also disrupts the weapons selection if you try to use the multiweapons and that tag isn't in the last weapon of the multiweapon list.
If you use a repairer unit against a damaged unit with an attached bomb say "bye, bye!" to that unit because you won't be able to trigger the BombDisarm weapon with enough time because the unit is being repaired by another weapon.

Try yourself if you aren't sure of my findings (I could be wrong) :-)

@FS-21
Copy link
Contributor Author

FS-21 commented Aug 12, 2025

FakeEngineer.DisarmBombs & FakeEngineer.CanDestroyBridges dont work

You are right about the FakeEngineer.CanDestroyBridges, I broke it days before I started this PR, I'm sorry. Now is fixed. You can have both repair & destroy tags in the same warhead and the bridge will be repaired or destroyed depending the current status of the bridge.
FakeEngineer.DisarmBombs is more "companion" of another WH's weapon.

As I mentioned to NetsuNegi I used this new disarm bombs tag in a repair weapon inside a multiweapon in a combat engineer with this weapons order:
1º) Offensive weapon (limited to attack enemies)
2º) Capture & Repair bridge weapon (limited to enemies)
3º) Repair weapon (limited to friendly and until the damaged reachs a 99% of the health, because I use the AttackFriendlies=yes for auto-targeting friendly stuff, including buildings and I had to restrict the continuous repairs to objects with <100% of health. Also this repair weapon includes the FakeEngineer.DisarmBombs for disarm bombs while is doing repairs).
4º) Last weapon with the classic DisarmBombs=yes in the warhead for other cases.

@fagonghaiwo
Copy link

when FakeEngineer.CanDestroyBridges=1 & FakeEngineer.CanRepairBridges=1 in a same warhead, bridge cant be repaired or destroyed

@FS-21
Copy link
Contributor Author

FS-21 commented Aug 12, 2025

when FakeEngineer.CanDestroyBridges=1 & FakeEngineer.CanRepairBridges=1 in a same warhead, bridge cant be repaired or destroyed

; general multiple small arms fire
[SA]
Verses=100%,80%,80%,25%,13%,13%,38%,25%,13%,100%,100%
InfDeath=1
AnimList=PIFFPIFF,PIFFPIFF
Bullets=yes
ProneDamage=70%
Tiberium=no
FakeEngineer.CanRepairBridges=true
FakeEngineer.CanDestroyBridges=true
fake engineer logic vs bridges 01

@fagonghaiwo
Copy link

bandicam 2025-08-12 19-33-24-499
sad
[FlakGuyATWH]
Versus.bridge=3%
FakeEngineer.CanRepairBridges=1 ; boolean
FakeEngineer.CanDestroyBridges=1 ; boolean
FakeEngineer.CanCaptureBuildings=1 ; boolean
FakeEngineer.DisarmBombs=1 ; boolean

@fagonghaiwo
Copy link

bandicam 2025-08-12 19-35-48-152
neither repair

@fagonghaiwo
Copy link

bandicam 2025-08-13 01-25-45-111
sad again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants